﻿using System;
using System.Threading;
using System.Windows;

namespace MyAnimelistRecommender
{
    /// <summary>
    /// Interaction logic for Bootloader.xaml
    /// </summary>
    public partial class SplashScreen : Window
    {
        public SplashScreen()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var disp = Dispatcher;
            new Thread(() =>
            {
                Thread.Sleep(6000);
                Dispatcher.Invoke((Action)delegate
                {
                    if (StarteEndlichEvent != null)
                    {
                        StarteEndlichEvent(this, null);
                    }
                });
            }).Start();
        }

        public event EventHandler StarteEndlichEvent;

        private void DoubleAnimation_Completed(object sender, EventArgs e)
        {
            this.Close();
            Dispatcher.InvokeShutdown();
        }
    }
}